import { Injectable } from '@angular/core';
import { RequestClass } from './request.service';
@Injectable()
export class MeterService {
    constructor(private requestclass: RequestClass) {}
    getMeterTypes = async () => {
        return await this.requestclass.request.Pget('/meter/getallmetertypes');
    };
    insertMeterInfo = async ({
        wellId,
        meterCode,
        meterName,
        meterNo,
        status,
        createTime,
    }) => {
        return await this.requestclass.request.post('/meter/insertmeterinfo', {
            params: {
                wellId,
            },
            data: {
                meterCode,
                meterName,
                meterNo,
                status,
                createTime,
            },
        });
    };
    updateMeterInfo = async ({ meterId, meterCode, meterNo, meterName, status, createTime }) => {
      return await this.requestclass.request.put('/meter/updatemeterinfo', {
        data: {
          meterId,
          meterCode,
          meterNo, // 类型
          meterName,
          status,
          createTime,
        },
      })
    }
    deleteMeterInfo = async ({ meter_id }) => {
      return await this.requestclass.request.delete('/meter/deletemeterinfo', {
        params: {
          meterId: meter_id,
        },
      })
    }
}
